module = {}
local wibox = require('wibox')

function module.refresh()
	local file= io.popen("amixer sget 'Master'")
	local info = file:read("*a") or "unkown"
	local volume=string.gsub(info,".*%[(%d+%%)%].*","%1")
	widget=wibox.widget{
	markup = '<span font="WenQuanYi Zen Hei 9">声音:'..volume..' </span>',
	align = 'center',
	valign = 'center',
	widget = wibox.widget.textbox
}
return widget
end

function module.increase_volume()
	os.execute('amixer set Master 5%+')
end

function module.decrease_volume()
	os.execute('amixer set Master 5%-')
end

return module
